package autoz.core.tools;

import org.eclipse.epsilon.eol.execute.context.IEolContext;
import org.eclipse.epsilon.eol.models.IModel;

public class AliasTool {

	IEolContext context;
	
	public AliasTool(IEolContext context){
		this.context = context;
	}
	
	/**
	 * Determines whether there are any models in the repository with the 
	 * specified alias.
	 * @param alias
	 * @return
	 */
	public boolean isAliasDefined(String alias) {
		for (IModel m : context.getModelRepository().getModels()) {
			if (m.getAliases().contains(alias)){
				return true;
			}
		}
		
		return false;
	}
	
}
